<?
if(!defined('L_ADMOD')) {echo "<meta http-equiv='refresh' content='0; url=/?nma=error&act=403'>";exit;}
include("./inc/bloced.php");


$select_razd=mysql_query("SELECT * FROM ".$wcpref.$op."_razd ORDER BY mod_nomer ASC");

$select_tag='<select name="new_razd" id="sel_razd" onchange="CheckRazdel(\'sel_razd\')">
	<option value="0" selected>'._SELECTRAZD_;
while($result_razd=mysql_fetch_array($select_razd))
{
	extract($result_razd);
	$select_tag.='<option value="'.$mod_id.'">'.$mod_id.'. '.$mod_razdel;
}
$select_tag.='</select>';

include("./php/spaw2/spaw.inc.php");
$spaw1 = new SpawEditor('new_text',$mod_opis);	
$spaw1->hideModeStrip();
$spaw1->addToolbars("edit", "format", "insert", "table", "font", "style", "tools");

print '<br><br><form name="form" method="post" action="admin.php?op='.$op.'&flag=goto&action=newp">
	<table border="0" cellpadding="1" cellspacing="1" align="center" width="60%">
		<tr class="even">
			<td align="right">
				'._NAMEPAGE_.'
			</td>
			<td>
				<input type="text" name="new_name" size="50">
			</td>
		</tr>
		<tr class="odd">
			<td align="right">'._RAZDEL_.'</td>
			<td>'.$select_tag.'</td>
		</tr>
		<tr class="even">
			<td align="right">
				'._NOMER_.'
			</td>
			<td>
				<input type="text" name="new_nom" size="50" id="nom">
			</td>
		</tr>
		<tr class="odd">
			<td colspan="2">';
				$spaw1->show();
			print'</td>
		</tr>
		<tr>
			<td colspan="2" class="head" align="center"><input type="submit" value="'._ADD_.'"></td>
		</tr>
	</table>
</form>';
?>

<script language="JavaScript">
function CheckRazdel(id)
{
	var sel;
	sel=document.getElementById(id).value;
	if (sel>0)
		document.getElementById("nom").value=sel+".";
	else
		document.getElementById("nom").value="";
}
</script>